
function saveParticipate(){
    var partakeUser = $("#partakeUser").val();
    if(partakeUser == ""){
        alert("参与人不能为空");
        return;
    }
    var time = getParam("time");
    var id = getParam("id");


    var ajax = new $ax("/participate/saveTime", function (data) {
        // 成功
        if (data.status == "true") {
            alert("添加成功");
            window.location.href='participate.html?time='+time;
        } else {
            alert("添加失败");
        }

    }, function (data) {
        // 失败
        alert("访问失败");
        errorAjax();
        alert("添加失败");
    });

    ajax.setToken(cookie.get("token"));
    ajax.set("partakeUser",partakeUser);
    ajax.set("time",time);
    ajax.set("id",id);
    ajax.start();

}

var tempParticipatID = 0;
// 添加参与者
function addParticipate() {
    $("#participateList").append("<div class=\"form-group\"><label class=\"col-sm-2 control-label\">参与者：</label><div class=\"col-sm-10\"><input type=\"text\" class=\"form-control\" name=\"participate\" required=\"\"></div></div>");
}


//return y + '-' + m + '-' + d +' '+h+':'+minute;
function formatDateTimeYMDHM(inputTime) {
    var date = new Date(inputTime);
    var y = date.getFullYear();
    var m = date.getMonth() + 1;
    m = m < 10 ? ('0' + m) : m;
    var d = date.getDate();
    d = d < 10 ? ('0' + d) : d;
    var h = date.getHours();
    h = h < 10 ? ('0' + h) : h;
    var minute = date.getMinutes();
    var second = date.getSeconds();
    minute = minute < 10 ? ('0' + minute) : minute;
    second = second < 10 ? ('0' + second) : second;
    // return y + '-' + m + '-' + d+' '+h+':'+minute+':'+second;
    return y + '-' + m + '-' + d +' '+h+':'+minute;
};